﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using log4net;
using SysAdmin._03_Service._00_Db;
using SysAdmin._04_Form._00_Common;

namespace SysAdmin._04_Form._04_Fee
{
    public partial class GenerateFeeForm : Form
    {
        private static ILog _logger = LogManager.GetLogger(typeof(GenerateFeeForm));

        public GenerateFeeForm()
        {
            InitializeComponent();
        }

        private void GenerateFeeForm_Load(object sender, EventArgs e)
        {

        }

        private void GenerateFeeForm_Shown(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                if (UICommonTool.ShowConfirmDialog("确定要生成记账数据吗？"))
                {
                    string date = dateTimePicker1.Value.ToString("yyyy-MM-dd");
                    FeeService.CalcAllFee(date);
                    UICommonTool.ShowInfoDialog("生成记账数据成功！");
                }
            }
            catch (Exception ex)
            {
                _logger.Error(ex);
                UICommonTool.ShowAlertDialog(ex.Message);
            }
        }
    }
}
